package com.xwyzsn.rentcar;

import com.xwyzsn.rentcar.service.NoticeService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@SpringBootApplication
@MapperScan(value = "com.xwyzsn.rentcar.mapper")
@EnableScheduling
public class RentCarApplication {

    @Autowired
    private NoticeService noticeService;
    public static void main(String[] args) {
        SpringApplication.run(RentCarApplication.class, args);
    }

    @Scheduled(cron = "*/10 * * * * *")
    public void test(){
        System.out.println("running...");
        noticeService.autoRun();
    }


}
